﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FJERP.Model;
using System.Data;

namespace FJERP.DAL
{
    public class JournalDAL
    {
        SQLHelper H = new SQLHelper();
        /// <summary>
        /// 日志显示
        /// </summary>
        /// <returns></returns>
        public List<Journal> Journal_Show()
        {

            string str = "select Journa_Date,JournalIP,Employee_Name,Journa_Content from Journal inner join Employee on Journal.Employee_Id=Employee.Employee_Id";
            DataTable table = H.ExecDataTable(str);
            List<Journal> list = new List<Journal>();
            foreach (DataRow item in table.Rows)
            {
                Journal J = new Journal();
                J.Employee_Name = item["Employee_Name"].ToString();
                J.Journa_Date = Convert.ToDateTime(item["Journa_Date"]);
                J.Journa_Content = item["Journa_Content"].ToString();
                J.JournalIP = item["JournalIP"].ToString();
                list.Add(J);
            }
            return list;
        }
    }
}
